Post

Replies

Boosts

Views

Activity

Reply to Push Notification Gets Removed From Notification Screen When Setting "badge" to 0
What is funny, though, is that "removing the badge" in the extension seems to fix the issue, at least temporarily. If if remove the variable under "badge" (NSNumber) the notification seems to work. It's only the "zero" value that causes the issue. I will update the ticket as well. class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) if let bestAttemptContent = bestAttemptContent { if let badge = bestAttemptContent.badge, badge.intValue < 1 { bestAttemptContent.badge = nil } contentHandler(bestAttemptContent) } else { contentHandler(request.content) } }
5d